<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>附件的人</title>
    <style type="text/css">
      body {
        padding: 20px;
      }
      ul {
        padding: 0;
        margin-bottom: 15px;
      }
      ul li {
        display: flex;
        align-items: center;
        width: 100%;
        margin-bottom: 15px;
      }
      ul li >* {
        margin-left: 10px;
      }
      ul li img {
        width: 50px;
        /* height: 50px; */
        border-radius: 8px;
      }
      input {
        margin-bottom: 10px;
      }
      input[name=location] {
        width: 200px;
      }
    </style>
  </head>
  <body>
    <ul>
      {{each heros}}
      <li>
        <img src="{{$value.img}}">
        <span>{{$value.nickname}}</span>
        <span>距离我 {{$value.dist.calculated}} 米</span>
      </li>
      {{/each}}
    </ul>
    
    <hr >
    
    <!-- 同步表单上传文件的时候，表单，一定要加上enctype="multipart/form-data" -->
    <form action="/add" method="post" enctype="multipart/form-data">
      网名:&nbsp;<input type="text" name="nickname"><br>
      头像:&nbsp;<input type="file" name="avater"><br>
      我的位置:&nbsp;<input type="text" name="location" placeholder="longitude,latitude"><br>
      <button>添加</button>
    </form>
  </body>
</html>
